if exists (select 1 from sysobjects where name = 'vw_activearbeitsplan' and type = 'V')
begin
   drop view vw_activearbeitsplan
   print 'View: vw_activearbeitsplan deleted ...'
end
go
create view vw_activearbeitsplan
as
     select PlanID 
       from ArbeitsPlan
      where ArbeitsPlan.Status = 1
go
print 'View: vw_activearbeitsplan done ...'
go
grant select on vw_activearbeitsplan to prsadmins with grant option
go
grant select on vw_activearbeitsplan to prsusers
go